package com.liu.web;

import org.springframework.web.context.AbstractContextLoaderInitializer;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.AnnotationConfigWebApplicationContext;

public class WebApp2 extends AbstractContextLoaderInitializer {
    @Override
    protected WebApplicationContext createRootApplicationContext() {
        //spring mvc工厂类 读取 注解配置
        AnnotationConfigWebApplicationContext context = new AnnotationConfigWebApplicationContext();
        //注册bean 组件类
        context.register(WebApp.class);
        return context;
    }
}
